<template>
    <div>
        <van-nav-bar title="标题" fixed/>
        <div style="height: 50px;"></div>
        <van-search v-model="value" shape="round" background="#4fc08d" placeholder="请输入搜索关键词" @click="dj"/>
        <van-tabs v-model:active="active" animated>
            <van-tab title="推荐">
                <van-swipe :autoplay="3000" lazy-render>
                    <van-swipe-item v-for="image in images" :key="image">
                        <img :src="image" style="width: 100%; height: 200px;" />
                    </van-swipe-item>
                </van-swipe>
                <van-grid :column-num="4">
                    <van-grid-item v-for="item in catitems" :icon="item.image_src" :text="item.name" />
                </van-grid>
                <!-- message -->

                <div v-for="item in floordata">
                    <img :src="item.floor_title.image_src" alt="">
                    <div v-for="items in  item.product_list" >
                        <img :src="items.image_src" alt="" style="width: 120px;height: 120px; float: left;">
                    </div>
                </div>


            </van-tab>
            <van-tab title="特惠">内容 2</van-tab>
            <van-tab title="美妆">内容 3</van-tab>
            <van-tab title="零食">内容 4</van-tab>
            <van-tab title="饮品">内容 1</van-tab>
            <van-tab title="生活">内容 2</van-tab>
            <van-tab title="零食">内容 4</van-tab>
            <van-tab title="饮品">内容 1</van-tab>
            <van-tab title="生活">内容 2</van-tab>
        </van-tabs>

    </div>
</template>

<script setup>
import router from '@/router';
import { ref } from 'vue';
//       导航        楼层
import { catitemsApi,floordataApi } from '@/api/api';
let catitems=ref([]);
let floordata=ref([]);
catitemsApi().then(res=>{
    console.log('导航',res)
    catitems.value=res.data.message

})
floordataApi().then(res=>{
    console.log('楼层',res)
    floordata.value=res.data.message

})

let dj=()=>{
    router.push('/index/gwc')
}
const images = [
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg',
];
</script>

<style lang="scss" scoped></style>